using System.Collections;
using DataAccess;
using Model;


namespace Service
{

    public class PreventiveService : ServiceBase
    {
        PreventiveDataAccess mgr;
        public PreventiveService()
        {
            mgr = new PreventiveDataAccess();
        }

       
        public Preventive GetPreventiveById(int preventiveId)
        {
            return mgr.GetPreventiveById(preventiveId);
        }
        public IList GetMaintenanceCategoryByTypeId(int typeId)
        {
            return mgr.GetMaintenanceCategoryByTypeId(typeId);
        }

        public void SavePreventive(Preventive preventive)
        {
            mgr.Save(preventive);

        }

        public void DeletePreventive(int preventiveId)
        {
            mgr.DeleteObject("From Preventive where PreventiveId =" + preventiveId);
        }
        public MaintenanceCategory IsAlreadyExistMaintenanceCategory(int typeId, string description)
        {
            return mgr.IsAlreadyExistMaintenanceCategory(typeId, description);
        }
        public void SaveMaintenanceCategory(MaintenanceCategory category)
        {
             mgr.Save(category);
        }



    }
}
